package com.example.demo.controller;


import com.example.demo.commom.Result;
import com.example.demo.entity.User;
import com.example.demo.service.UpdateUserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/UpdateUser")
@Api(tags = "后端参数校验", description = " 0328 王晓月")
public class UpdateUserInfo {


    @Autowired
    private UpdateUserInfoService updateUserInfoService;

    @PostMapping("/EditProfile")
    @ApiOperation(value = "修改个人信息 0328 王晓月")
    public Result<?> register(@RequestBody  @Validated User user) {
        updateUserInfoService.update(user);
        return Result.success();
    }

}
